package com.yeyaomai.dksns.flowis.domain.flowisdetail;

import java.util.LinkedHashMap;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.yeyaomai.dksns.flowis.page.SplitConstant;

/**
 * 
 * @author dingtao@yeyaomai.com
 * 
 *         查询条件 order
 */
public class FlowisQueryOrder {

	/**
	 * sort 排序 key --->字段名 -------------- value(ASCENDING, DESCENDING)----->
	 * 升序还是降序
	 * 
	 * @see org.springframework.data.mongodb.core.query.Order
	 */
	private LinkedHashMap<String, String> sort;

	/**
	 * 每页多少条
	 */

	private int pageSize = SplitConstant.PAGE_SIZE;

	/**
	 * ip 地址
	 */
	private String ip;

	/**
	 * 城市
	 */
	private String access_city;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 端口号
	 */
	private String user_dkcode;

	/**
	 * 开始时间
	 */
	private String startTime;

	/**
	 * 结束时间
	 */
	private String endTime;

	/**
	 * 第几页 默认第一页
	 */
	private String number = "1";

	/**
	 * 区分是那一天 还是 区间
	 */
	private boolean period;

	/**
	 * 
	 * 日期 --day 0 表示今天 -1 昨天 -2 前天 ..... NA 标识忽略 时间
	 */
	private String day = "0";

	/**
	 * 小时 -1 代表全天查询
	 */
	private String hour = "-1";

	/**
	 * 页面
	 */
	private String page;
	/**
	 * 
	 * 路径
	 */
	private String url;
	
	public boolean isPeriod() {
		return period;
	}

	public void setPeriod(boolean period) {
		this.period = period;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getStartTime() {
		return startTime;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getDay() {
		return day;
	}

	public void setDay(String day) {
		this.day = day;
	}

	public String getHour() {

		return hour;
	}

	public void setHour(String hour) {
		this.hour = hour;
	}

	public void setSort(LinkedHashMap<String, String> sort) {

		this.sort = sort;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getAccess_city() {
		return access_city;
	}

	public void setAccess_city(String access_city) {
		this.access_city = access_city;
	}

	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	public LinkedHashMap<String, String> getSort() {
		return sort;
	}

	public void addSort(String property, String desc) {
		if (this.sort == null) {
			this.sort = new LinkedHashMap<String, String>();
		}
		getSort().put(property, desc);
	}

	@Override
	public String toString() {

		return ToStringBuilder.reflectionToString(this);
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUser_dkcode() {
		return user_dkcode;
	}

	public void setUser_dkcode(String user_dkcode) {
		this.user_dkcode = user_dkcode;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
